<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/jsplib/pubhead.jsp"%>
<%@ page import="net.comm.common.ValueMaping" %>
<%@ taglib uri="/WEB-INF/myTaglib.tld" prefix="tag"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<TITLE>学校管理</TITLE>
	<link rel="stylesheet" type="text/css" href="${cpath}/css/adgloab.css"/>
	<link rel="stylesheet" type="text/css" href="${cpath}/css/adstyle.css" />

	<script type="text/javascript" src="${cpath}/fckeditor/fckeditor.js"></script>
	<SCRIPT src="${cpath}/js/location.js" type=text/javascript></SCRIPT>
	<SCRIPT src="${cpath}/js/location_array.js" type=text/javascript></SCRIPT>
	
</head>
<body>
<script> 
	//转页面
	var curUserID = '${userID}';
	if((curUserID == "")||(curUserID == null)){
//		parent.window.location.replace("${cpath}/index.jsp"); 
	}
</script>

		<DIV id=admin>

		<!-- 右侧宽栏 {{{ -->
		<DIV class=group_mid>
			<div class='subtop' >
				<p><a href="#"><img src="${cpath}/images/png-0222.png" ></a></p>
				<dl >
					<dt class="tit"><a href="#">学校管理</a></dt>
					<dd class="intro"><span>&nbsp;</span></dd>
				</dl>
				<div class='fun'>
					<li><a href="javascript:history.go(-1);">返回上一页</a></li>
				</div>
			</div>
			<DIV class='whole'><!-- 右侧宽栏 }}}-->
				<form action="${cpath}/school.do" name="theForm"  method="post" enctype="multipart/form-data" >
					<UL class=detailinfo>
						<LI><STRONG>中文名称:</STRONG><EM>
								<input type="text" name='sh_name' value='${theForm.sh_name}' maxlength="100" class="long"/></EM></LI>
						<LI><STRONG>英文名称:</STRONG><EM>
								<input type="text" name='sh_enName' value='${theForm.sh_enName}' maxlength="100" class="long"/></EM></LI>
						<LI><STRONG>详细介绍:</STRONG><EM>
								<textarea name="sh_info" rows="8" cols="40" >${theForm.sh_info}</textarea></EM></LI>
						<LI><STRONG>简&nbsp;&nbsp;&nbsp;&nbsp;介:</STRONG><EM>
								<textarea name="sh_simpinfo" rows="4" cols="69" >${theForm.sh_simpinfo}</textarea></EM></LI>
						<LI><STRONG>所在地区:</STRONG><EM>
							<SELECT id=sh_location style="WIDTH: 80px" onchange="javascript:change_location(this.value,'sh');" 
							name=sh_location value=''></SELECT>
							<SELECT id=sh_sublocation style="WIDTH: 100px" name=sh_sublocation value=''></SELECT>
							</EM></LI>
							<SCRIPT type=text/javascript>init_location('${theForm.sh_location}','${theForm.sh_sublocation}', 'sh');</SCRIPT>
						<LI><STRONG>通讯地址:</STRONG><EM>
								<input type="text" name='sh_addr' value='${theForm.sh_addr}' maxlength="100" class="long"/></EM></LI>
						<LI><STRONG>邮&nbsp;&nbsp;&nbsp;&nbsp;编:</STRONG><EM>
								<input type="text" name='sh_zipcode' value='${theForm.sh_zipcode}' maxlength="100" class="short"/></EM></LI>
						<LI><STRONG>联&nbsp;系&nbsp;人:</STRONG><EM>
								<input type="text" name='sh_contacts' value='${theForm.sh_contacts}' maxlength="100" class="short"/></EM></LI>
						<LI><STRONG>联系电话:</STRONG><EM>
								<input type="text" name='sh_tel' value='${theForm.sh_tel}' maxlength="100" class="short"/></EM></LI>
						<LI><STRONG>学校LOGO:</STRONG><EM>
							<input type="file" name='picFile' value='' class="long"/></EM></LI>
						<LI><STRONG>状&nbsp;&nbsp;&nbsp;&nbsp;态:</STRONG><EM>
							<tag:ARRAY  id="sh_sts" name="sh_sts" options="<%=ValueMaping.SHSTS_FLG%>" value='${theForm.sh_sts}'/></EM></LI>

						<!--隐藏域-->
						<input type="hidden" name='sh_ID'		value='${theForm.sh_ID}'/>
						<input type="hidden" name='action'		value='${theForm.action}'/>
						<input type="hidden" name='pic'			value='${theForm.pic}'/>
						<input type="hidden" name='picPath'		value='${theForm.picPath}'/>

					</UL><!--结束 }}}-->
					<UL class=detailinfo>
						<li class=btn>	
							<input type="button" name="save"  id="save" onclick="javascript:doConfirm();" class="shortBtn" value="保   存"/>&nbsp;
							<input type="button" name="cancel"  id="cancel" onclick="javascript:history.go(-1);" class="shortBtn" value="取   消"/>&nbsp;
						</li>
					</UL>
				</form>
			</DIV><!-- whole end }}} -->			

			</DIV><!-- content }}} -->
		</DIV><!-- profile_mid }}} -->
		</DIV><!-- group end }}} -->
<br><br><br>
</body>
</html>
<!---->
<script type="text/javascript">
  var oFCKeditor = new FCKeditor('sh_info');		//传入参数为表单元素（由FCKeditor生成的input或textarea）的name
      oFCKeditor.BasePath='${cpath}/fckeditor/';	//指定FCKeditor根路径，也就是fckeditor.js所在的路径
      oFCKeditor.Height='260px';
      oFCKeditor.Width='580px';
      oFCKeditor.ToolbarSet='Demo';					//指定工具栏
	  oFCKeditor.ReplaceTextarea();
</script>
<script>
    /**
     * 检查项目资料维护
     */
	function doConfirm()
	{
		var form = document.theForm;

		var action = form['action'];
		var sh_name = form['sh_name'];
		var sh_simpinfo = form['sh_simpinfo'];
		var sh_info = FCKeditorAPI.GetInstance("sh_info").GetXHTML("true");   

		if(sh_name.value == null||sh_name.value.replace(/(^\s*)|(\s*$)/g,"").length < 1)
  		{
			alert('中文名称不能为空');
			sh_name.select();
			return ;
		}
		if(sh_simpinfo.value.length > 255)
		{
			alert('简介内容长度不能大于255');
			sh_simpinf.select();
			return ;
		}
		if(sh_info.length > 2000)
		{
			alert('介绍内容长度不能大于2000');
			return ;
		}
		form.submit();
	}

	/**
   * 根据具体请求设置各个组件状态	
   */
  function showState()
	{
		var action = '${theForm.action}';
		var form = document.theForm;		
		if(action == 'detail')
		{
           
			document.getElementById("back").style.display = "none";

		}
		else if(action == 'modifyPage' || action == 'update')
		{

			form['action'].value = 'update';
		}else{

			form['action'].value = 'add';
		}

	}
	showState();


</script>

